﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataProcessing
{
    public class CaculationCache
    {
        public CaculationCache()
        {
            Window = new ValueRange();
            Accumulation = 0;
            SamplesFallingIn = new List<ChrSampling>();
        }
        public ValueRange Window
        {
            get;set;
        }

        /// <summary>
        /// int is enough for this
        /// </summary>
        public uint Accumulation
        {
            get;set;
        }

        public List<ChrSampling> SamplesFallingIn
        {
            get;set;
        }

        /// <summary>
        /// 假定不会有加重的
        /// </summary>
        /// <param name="sample"></param>
        public void AddSample(ChrSampling sample)
        {
           // SamplesFallingIn.
            SamplesFallingIn.Add( sample);

            //贡献就是这么多
            Accumulation += Window.OverlappedLength(sample.Window);
        }
    }
}
